#include<stdio.h>
#define N 100
int main(void)
{
	int n, num, i, k = 0, cnt = 0;
	int child[N] = { 0 };
	scanf("%d %d", &n, &num);
	for (i = 1; i <= n; i++)
	{
		child[i] = i;
	}

	for(cnt = 0; cnt < n - 1; cnt++)
	{
		for (i = 1; i <= num; i++)
		{
			k++;
			if (k > n) k -= n;
			while (child[k] == 0)
			{
				k++;
				if (k > n) k -= n;
			}
		}
		if (k > n) k -= n;
		child[k] = 0;
	}

	for (i = 1; i <= n; i++)
	{
		if (child[i] != 0) break;
	}

	printf("The left child is NO %d.\n", i);

	return 0;
}
